package io.renren.modules.mybog.fromControoler;



import io.renren.modules.mybog.entity.MessageEntity;
import io.renren.modules.mybog.fromControoler.utiles.R;
import io.renren.modules.mybog.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 小🌤
 * @since 2021-03-21
 */
@RestController
@RequestMapping("/bolg/message")
public class MessageControllers {
 @Autowired
    private MessageService messageService;

  @PostMapping("/save")
    public R save (@RequestBody(required = false) MessageEntity message){
      boolean save = messageService.save(message);
      return save?R.ok():R.error();
  }
}

